package com.practice.bootdemo.common;

/**
 * @author :admin
 * @description: TODO edit class Description
 * @create date: 2019/12/11 22:37
 */
public class ResponseUtil {
    private ResponseUtil() {
    }
    public static ResultResponse successResponse(Object result){
        return new ResultResponse(result,CodeResponse.SUCCESS.getDesc(),CodeResponse.SUCCESS.getCode());
    }


    public static ResultResponse failResponse(String msg){
        return new ResultResponse("",msg,CodeResponse.FAIL.getCode());
    }

    public static ResultResponse failResponse(String msg,String errCode){
        return new ResultResponse("",msg,errCode);
    }

    public static ResultResponse failResponse(){
        return new ResultResponse("",CodeResponse.FAIL.getDesc(),CodeResponse.FAIL.getCode());
    }
}
